const ip = '192.168.159.1:8080' 
// 192.168.159.1
// const ip = '124.71.211.116'
const BASE_URL = 'http://'+ip
const WS_URL = 'ws://'+ip

export default {
	BASE_URL,
	WS_URL
}
 
export const sendRequest = (options) => {
	uni.request({
		url: BASE_URL + options.url,
		header: {'token':uni.getStorageSync('token')},
		method: options.method || 'GET',
		data: options.data || {},
		success: (res) => { 
			options.success(res)
 
		},
		fail: (err) => {
			uni.showToast({
				title: "请求接口失败"
			})
			reject(err)
		}
	})
 
}